<!DOCTYPE HTML>
<html ng-app="myApp">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>无标题文档</title>
    <style>
        #div1 div,#div2 div{ width:200px; height:200px; border:1px red solid; display:none;}
        #div1 input.active , #div2 input.active{ background:red;}
    </style>
    <script src="../../js/plugins/angular/angular.min.js" type="text/javascript"></script>
<script>

var m1 = angular.module('myApp',[]);
m1.directive('myTab',function(){
	return {
		restrict : 'E',   
		replace : true,
		//scope : true,
		scope : {
			myId : '@',// 普通字符串
			myName : '=',
			myFn : '&'//变量数据
		},
		controller : ['$scope',function($scope){
			$scope.name = 'miaov';
		}],
		templateUrl : 'temp2.html'
	};
});

m1.controller('Aaa',['$scope',function($scope){
	
	$scope.name = 'hello';
	$scope.show = function(n){
		alert(n);
	};
	
}]);


</script>
</head>

<body ng-controller="Aaa">
<!-- my-name="name" name的值位hello -->
<my-tab my-id="div1" my-name="name" my-fn="show(num)"></my-tab>
<my-tab my-id="div2" my-name="name" my-fn="show(num)"></my-tab>
</body>
</html>
